
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<%@ page import="java.sql.SQLException" %>
<%@ page import="cn.medemede.beans.vo.User" %>
<html>
<head>
    <title>登陆成功</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <meta http-equiv="content-type" content="text/html" charset="utf-8"/>
    <style>
        p{
            font-family: "Microsoft YaHei", "微软雅黑", "SimSun", "宋体", serif;
            color: #00adee;
        }
        body
        {
            background:
                    radial-gradient(black 15%, transparent 16%) 0 0,
                    radial-gradient(black 15%, transparent 16%) 8px 8px,
                    radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 0 1px,
                    radial-gradient(rgba(255,255,255,.1) 15%, transparent 20%) 8px 9px;
            background-color:#282828;
            background-size:16px 16px;

        }
        .base{
            background-color: #fff;
            background-image:
                    linear-gradient(90deg, transparent 79px, #abced4 79px, #abced4 81px, transparent 81px),
                    linear-gradient(#eee .1em, transparent .1em);
            background-size: 100% 1.2em;
            width: 500px;
            height: 460px;

        }
    </style>
</head>
<body>
<h1 style="text-align: center;margin-top: 40px"><p>登陆成功！</p></h1>
<hr>
<%  request.setCharacterEncoding("utf-8");
    response.setContentType("text/html;charset=UTF-8");
    User user=new User();
    try {
        user.setIt((String) session.getAttribute("username"));
    } catch (SQLException e) {
        e.printStackTrace();
    }
%>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.1.1.js"></script>
<script>
    function check() {
        if (confirm("注销?")){
            $.post("/servlet/JServlet",{
                actionName:"clear"},
                function (data) {
                    if (data.search("clearSuc")!=-1){
                        window.location.href="index.jsp";
                    }else {
                        alert("对不起，注销失败！请重试。");
                    }
                }
            );
        }
    }
</script>
<div style="text-align: center;margin:140px auto" class="base">

    <table style="text-align: center;margin: 20px auto;" >
        <tr>
            <td height="50px" width="300px"><h3>姓名</h3></td>
            <td width="300px" ><h3><%=user.getZname()%></h3></td>
        </tr>
        <tr>
            <td height="50px"><h3>性别</h3></td>
            <td><h3><%=user.getSex()%></h3></td>
        </tr>
        <tr>
            <td height="50px"><h3>年龄</h3></td>
            <td><h3><%=user.getAge()%></h3></td>
        </tr>
        <tr>
            <td height="50px"><h3>出生日期</h3></td>
            <td><h3><%=user.getBorth()%></h3></td>
        </tr>
        <tr>
            <td height="50px"><h3>地区</h3></td>
            <td><h3><%=user.getZposition()%></h3></td>
        </tr>
        <tr>
            <td height="50px"><h3>爱好</h3></td>
            <td><h3><%=user.getFavorite()%></h3></td>
        </tr>
        <tr>
            <td height="50px"><h3>联系方式</h3></td>
            <td><h3><%=user.getPhone()%></h3></td>
        </tr>
        <tr>
            <td height="50px"><h3>Email</h3></td>
            <td><h3><%=user.getEmail()%></h3></td>
    </table>
        <input type="button" class="button blue bigrounded" align="center" style="margin-top:60px" onclick="location='change.jsp'" value="修改" />
        <input type="button" class="button blue bigrounded" align="center" style="margin-top:60px" onclick="check()" value="注销" />
    </div>

</body>
</html>
